package com.thuanpq60023.easyenglish.bus;

import com.thuanpq60023.easyenglish.adapter.VocabularyAdapter;
import com.thuanpq60023.easyenglish.entity.VocabEntity;
import android.content.Context;

public class VocabularyBus {
	private VocabularyAdapter mDbAdapter;

	public VocabularyBus(Context context) {
		mDbAdapter = new VocabularyAdapter(context);
	}

	public boolean insertVocab(VocabEntity entity) {
		return mDbAdapter.insertVocab(entity);
	}

	public boolean deleteVocabByWordAndType(String word, String type) {
		return mDbAdapter.deleteVocabByWordAndType(word, type);
	}

	public boolean deleteVocabByMean(String mean) {
		return mDbAdapter.deleteVocabByMean(mean);
	}

	public boolean updateVocabByWord(VocabEntity entity) {
		return mDbAdapter.updateVocabByWord(entity);
	}

	public VocabEntity[] getAllVocab() {
		return mDbAdapter.getAllVocab();
	}

	public VocabEntity[] getVocabByUnit(String unit) {
		return mDbAdapter.getVocabByUnit(unit);
	}

	public VocabEntity getVocabInUnitByRate(String unit) {
		return mDbAdapter.getVocabInUnitByRate(unit);
	}

	public VocabEntity getVocabByWordAndType(String word, String type) {
		return mDbAdapter.getVocabByWordAndType(word, type);

	}

	public VocabEntity[] getVocabByRandom(VocabEntity entity, int quantity) {
		return mDbAdapter.getVocabByRandom(entity, quantity);
	}
}
